<?php
/**
 * Create by 11li
 * Date 2020/3/30
 * Time 23:33
 *
 */

namespace app\common\service\v2;


use app\common\model\OrderShipping;

class ShippingService
{
	
	/**
	 * 添加发货记录
	 * @param $orderId
	 * @param $shippingName
	 * @param $shippingNo
	 * @param int $agentId
	 * @return false|int
	 */
	public static function addRecord($orderId, $shippingName, $shippingNo, $agentId = 0) {
		$model = new OrderShipping();
		return $model->isUpdate(false)
			->save([
				'order_id' => $orderId,
				'shipping_name' => $shippingName,
				'shipping_no' => $shippingNo,
				'agent_id' => $agentId
			]);
	}
}